package com.foreknow.practice.lala;

import java.util.Scanner;

public class Test7 {
  //  编写程序：由键盘输入三个整数分别存入变量number1、number2、number3， 对它们进行排序，并且从小到大输出。
  public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
      System.out.println("请输入第一个整数");
      int number1 = input.nextInt();
      System.out.println("请输入第二个整数");
      int number2 = input.nextInt();
      System.out.println("请输入第三个整数");
      int number3 = input.nextInt();

      int temp ;
      temp =number1;
      number1 =number2;
      number2= number3;
      number3=temp;

      if (number1<number2 && number1<number3){
          //判断number1最小
       if (number2<number3){
          System.out.println(number1+"小于"+number2+"小于"+number3);
      }else {
           System.out.println(number1 + "小于" + number3 + "小于" + number2);
       }
       //判断number2最小
      }else if (number2<number1 && number2<number3){
          if (number1<number3){

              System.out.println(number2+"小于"+number1+"小于"+number3);
          }else {
              System.out.println(number2 + "小于" + number3 + "小于" + number1);
          }
      }else {
          //判断3最小
          if (number1<number2){
              System.out.println(number3+"小于"+number1+"小于"+number2);

          }else {
              System.out.println(number3+"小于"+number2+"小于"+number1);
          }
      }


  }
}
